//
//  MainTabbarConrtroller.m
//  MeetCard
//
//  Created by timtian on 16/10/31.
//  Copyright © 2016年 timtian. All rights reserved.
//

#import "MainTabbarConrtroller.h"
#import "BaseNavigationController.h"

#import "ImgBrowseController.h"
#import "CustomerListController.h"
#import "LoginController.h"
#import "OpenOrderController.h"


#import <IQKeyboardManager/IQKeyboardManager.h>

#import "UIImage+Color.h"


@interface MainTabbarConrtroller ()
{
    BaseNavigationController* _navc;
}


@end

@implementation MainTabbarConrtroller

+(void)load {
    [IQKeyboardManager sharedManager].enableAutoToolbar = NO;
}

- (void)viewDidLoad {
    
    [super viewDidLoad];
    [self createViewController];
    [self createTabbarView];
    
}

-(void)createViewController
{
    ImgBrowseController* imgVC = [[ImgBrowseController alloc]init];
    
    CustomerListController *listVC = [[CustomerListController alloc] init];

    OpenOrderController *openOrderVC = [[OpenOrderController alloc]init];
    
    LoginController *loginVC = [[LoginController alloc] init];
    


    NSArray* arrayViews=@[imgVC,listVC,openOrderVC,loginVC];
    NSMutableArray* viewControllers=[NSMutableArray arrayWithCapacity:4];
    for (UIViewController* ViewControl in arrayViews) {
        _navc=[[BaseNavigationController alloc]initWithRootViewController:ViewControl];
        
        [viewControllers addObject:_navc];
        
    }
     
    self.viewControllers=viewControllers;
}

- (void)createTabbarView {
    
    self.tabBar.tintColor = kColor4B79AF;

    [self.tabBar setShadowImage:[UIImage lm_imageWithColor:[UIColor whiteColor]]];
    self.tabBar.backgroundImage = [UIImage lm_imageWithColor:kRGBCOLOR(255, 255, 255)];
    UITabBarItem *ufuliItem = self.tabBar.items[0];
    ufuliItem.title = @"价目表";
    
    ufuliItem.image = [UIImage imageNamed:@"main_discover2"];
    UIImage*selectImage=[UIImage imageNamed:@"main_discover1"];
    UIImage*selectOriginal=[selectImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    ufuliItem.selectedImage = selectOriginal;
    
    
    UITabBarItem *welfareItem = self.tabBar.items[1];
    welfareItem.image = [UIImage imageNamed:@"main_applied2"];
    UIImage*welfareImage=[UIImage imageNamed:@"main_applied1"];
    UIImage*welfareOriginal=[welfareImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    welfareItem.selectedImage = welfareOriginal;
    welfareItem.title = @"开单";
    
    
    
    UITabBarItem *shoppingItem = self.tabBar.items[2];
    shoppingItem.title = @"查询";
    shoppingItem.image = [UIImage imageNamed:@"main_manager2"];
    UIImage*shoppingImage=[UIImage imageNamed:@"main_manager1"];
    UIImage*shoppingOriginal=[shoppingImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    shoppingItem.selectedImage = shoppingOriginal;
    


    UITabBarItem *meItem = self.tabBar.items[3];
    meItem.title = @"客户信息";
    meItem.image = [UIImage imageNamed:@"main_me2"];
    UIImage*meImage=[UIImage imageNamed:@"main_me1"];
    UIImage*meOriginal=[meImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    meItem.selectedImage = meOriginal;
    
}


@end
